import request from '@/utils/request'

const baseUrl = '/role-menu'

export function create(data) {
  return request({
    url: `${baseUrl}`,
    method: 'post',
    data
  })
}

export function findAll(params) {
  return request({
    url: `${baseUrl}`,
    method: 'get',
    params
  })
}

export function findOne(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'get',
  })
}

export function update(id, data) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'patch',
    data
  })
}

export function remove(id) {
  return request({
    url: `${baseUrl}/${id}`,
    method: 'delete',
  })
}

export function roleAddMenu(data) {
  return request({
    url: `${baseUrl}/roleAddMenu`,
    method: 'post',
    data
  })
}

export function getMenuByRoleId(params) {
  return request({
    url: `${baseUrl}/getMenuByRoleId`,
    method: 'post',
    params
  })
}


